<template>
	<view class="timenav">
		<button @click="onSetTimeOut()" type="primary">单次计时器</button>
		<button @click="onSetTimeOut('cxz',666)" type="primary" plain="true">启动传参计时器</button>
		<button @click="onClearTimeOut()" type="warn">取消计时器</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			}
		},
		methods: {
             onSetTimeOut(){
				 console.log("onSetTimeOut()");
				 setTimeout(()=>{
					 console.log("onSetTimeOut() callback");
					 // -----
					 console.log("onSetTimeOut() callback end");
				 },3000)
			 },
			 onSetTimeOut(userName,psw){
				 console.log("onSetTimeOut()",userName,psw);
				 setTimeout((x,y)=>{
					 console.log("-------callback",x,y);
				 },2000,userName,psw)
			 }
		}
	}
</script>

<style>
.timenav button{
	margin-bottom: 10rpx;
}
</style>